/*
 *   Copyright 1999-2016 Asiainfo Technologies(China),Inc.
 *
 *   Licensed under the Apache License, Version 2.0 (the "License");
 *   you may not use this file except in compliance with the License.
 *   You may obtain a copy of the License at
 *
 *        http://www.apache.org/licenses/LICENSE-2.0
 *
 *   Unless required by applicable law or agreed to in writing, software
 *   distributed under the License is distributed on an "AS IS" BASIS,
 *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *   See the License for the specific language governing permissions and
 *   limitations under the License.
 *
 */

package com.asiainfo.redis.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import javax.servlet.Filter;

/**
 * @version v 1.0 on 2016/4/19 14:30
 * @auther william.xu
 */

@Configuration
public class FilterConfig {

//    @Bean
//    public FilterRegistrationBean sitemeshFilter2() {
//        FilterRegistrationBean registration = new FilterRegistrationBean();
//        registration.setFilter(new ConfigurableSiteMeshFilter());
//        registration.addInitParameter("configFile","classpath:sitemesh3.xml");
//        registration.addUrlPatterns("/*");
//        registration.setOrder(Ordered.LOWEST_PRECEDENCE);
//        return registration;
//    }

//The default configuration file should live in /WEB-INF/sitemesh3.xml in your web-application
//    <sitemesh>
//    <mapping path="/*" decorator="/decorator.html"/>
//    <mapping path="/admin/*" decorator="/admin-decorator.html"/>
//    </sitemesh>


    @Bean
    public Filter sitemeshFilter() {
        return new SiteMeshFilter();
    }

}
